<?php
/* @var $this InvoiceController */
/* @var $customer Customer */
/* @var $dataProvider Address */
/* @var $filtersForm */
/* @var $form CActiveForm */
?>

<?php
$this->breadcrumbs=array(
	'Rechnungen'=>array('invoice/admin'),
	'Neue Rechnung'=>array('invoice/createNewInvoice'),
	'Adressen auswählen',
);

setlocale(LC_ALL, "de_DE.UTF-8");

?>

<h4><?php echo("Kunde:" . " " . $customer->first_name . " " . $customer->last_name); ?></h4>

<h2>Schritt 2 von 3: Adresse wählen</h2>

<br>
<br>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'model-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php $form=$this->beginWidget('CActiveForm', array(
	    'enableAjaxValidation'=>true,
	)); ?>
	 
	<?php 	
		$columns = array(
		    array(
		        'id'=>'address_id',
		        'class'=>'CCheckBoxColumn',
		        'selectableRows' => '1',   
		    ),
		    array(
		        'header'=>CHtml::encode('Typ'),
		        'name'=>'type',
		    ),
		    array(
		        'header'=>CHtml::encode('Adresse'),
		        'name'=>'address',
		    ),
		    array(
		        'header'=>CHtml::encode('PLZ'),
		        'name'=>'postcode',
		    ),
		    array(
		        'header'=>CHtml::encode('Ort'),
		        'name'=>'place',
		    ),		 
			array(
		        'header'=>CHtml::encode('Land'),
		        'name'=>'country',
		    ),
		);
		 
		$this->widget('zii.widgets.grid.CGridView', array(
		    'id'=>'customer-grid',
		    'dataProvider'=>$dataProvider,
		    'columns'=>$columns,
		    'filter'=>$filtersForm,
		    'cssFile' => Yii::app()->getRequest()->getBaseUrl() . '/css/tableStyle.css',
		));
	?>
	
	<div class="row buttons">
		<?php //echo CHtml::submitButton("Auswählen", array("name"=>"step3")); ?>
		<?php echo CHtml::button('Auswählen', array('submit' => array('invoice/saveAndAddItems'))); ?>
	</div>
	<?php $this->endWidget(); ?>

<?php $this->endWidget(); ?>

</div><!-- form -->











